package com.jeez.module;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

@Controller(value = "/user")
public class UserController {
	
	@Autowired
	private RestTemplate restTemplate;

	@GetMapping(value = "hello/{name}")
	@ResponseBody
	public String hello(@PathVariable("name") String name) {
		String result = restTemplate.getForObject("http://jeez-sys-rest/user/hello/" + name, String.class);
		System.out.println(result);
		return result;
	}
}
